﻿@model Apps.Models.WMS.WMS_PartModel
@using Apps.Web.Core;
@using Apps.Common;
@using Apps.Models.WMS;
@using Apps.Web;
@using Apps.Locale;
@using Apps.Models.Sys;
@{
    ViewBag.Title = "创建";
    Layout = "~/Views/Shared/_Index_LayoutEdit.cshtml";
    List<permModel> perm = null;
}

<script type="text/javascript">
$(function () {
    $("#btnSave").click(function () {
        if ($("form").valid()) {
            $.ajax({
                url: "@Url.Action("Create")",
                type: "Post",
                data: $("form").serialize(),
                dataType: "json",
                success: function (data) {
                    if (data.type == 1) {
                        window.parent.frameReturnByMes(data.message);
                        window.parent.frameReturnByReload(true);
                        window.parent.frameReturnByClose()
                    }
                    else {
                        window.parent.frameReturnByMes(data.message);
                    }
                }
            });
        }
        return false;
    });
    $("#btnReturn").click(function () {
         window.parent.frameReturnByClose();
    });
});
function frameReturnByClose() {
$("#modalwindow").window('close');
}
function frameReturnByMes(mes) {
$.messageBox5s(Lang.Tip, mes);
}
</script>
<div id="modalwindow" class="easyui-window" style="width:800px; height:440px;" data-options="modal:true,closed:true,minimizable:false,shadow:false"></div>
<div class="mvctool bgb">
@Html.ToolButton("btnSave", "fa fa-save", Resource.Save,ref perm, "Save", true)
@Html.ToolButton("btnReturn", "fa fa-reply", Resource.Reply,false)
</div>
@using (Html.BeginForm())
{
             @Html.HiddenFor(model => model.Id, new { @Value = 0})
             <input id="CreateTime" type="hidden" name="CreateTime" value="2000-1-1" />
 <table class="formtable">
     <tbody>
         <tr>
             <th>
                 @Html.LabelFor(model => model.PartCode)：
             </th>
             <td>
                 @Html.EditorFor(model => model.PartCode)
             </td>
             <td>@Html.ValidationMessageFor(model => model.PartCode)</td>
         </tr>
         <tr>
             <th>
                 @Html.LabelFor(model => model.PartName)：
             </th>
             <td>
                 @Html.EditorFor(model => model.PartName)
             </td>
             <td>@Html.ValidationMessageFor(model => model.PartName)</td>
         </tr>
         <tr>
             <th>
                 @Html.LabelFor(model => model.PartType)：
             </th>
             <td>
                 @*@Html.EditorFor(model => model.PartType)*@
                 @Html.DropDownListFor(model => model.PartType, Apps.BLL.Sys.SysParamBLL.GetSysParamByType("PartType"))
             </td>
             <td>@Html.ValidationMessageFor(model => model.PartType)</td>
         </tr>
         <tr>
             <th>
                 主机厂编码：
             </th>
             <td>
                 @Html.EditorFor(model => model.CustomerCode)
             </td>
             <td>@Html.ValidationMessageFor(model => model.CustomerCode)</td>
         </tr>
         <tr>
             <th>
                 所属客户编码：
             </th>
             <td>
                 @Html.EditorFor(model => model.BelongCustomer)
             </td>
             <td>@Html.ValidationMessageFor(model => model.BelongCustomer)</td>
         </tr>
         <tr>
             <th>
                 所属供应商编码：
             </th>
             <td>
                 @Html.EditorFor(model => model.BelongSupplier)
             </td>
             <td>@Html.ValidationMessageFor(model => model.BelongSupplier)</td>
         </tr>
         <tr>
             <th>
                 @Html.LabelFor(model => model.LogisticsCode)：
             </th>
             <td>
                 @Html.EditorFor(model => model.LogisticsCode)
             </td>
             <td>@Html.ValidationMessageFor(model => model.LogisticsCode)</td>
         </tr>
         <tr>
             <th>
                 @Html.LabelFor(model => model.OtherCode)：
             </th>
             <td>
                 @Html.EditorFor(model => model.OtherCode)
             </td>
             <td>@Html.ValidationMessageFor(model => model.OtherCode)</td>
         </tr>
         <tr>
             <th>
                 @Html.LabelFor(model => model.PCS)：
             </th>
             <td>
                 @Html.EditorFor(model => model.PCS)
             </td>
             <td>@Html.ValidationMessageFor(model => model.PCS)</td>
         </tr>
         <tr>
             <th>
                 保管员(必输)：
             </th>
             <td>
                 @Html.EditorFor(model => model.StoreMan)
             </td>
             <td>@Html.ValidationMessageFor(model => model.StoreMan)</td>
         </tr>
         <tr>
             <th>
                 单位：
             </th>
             <td>
                 @Html.EditorFor(model => model.Unit)
             </td>
             <td>@Html.ValidationMessageFor(model => model.Unit)</td>
         </tr>
         <tr>
             <th>
                 每箱体积：
             </th>
             <td>
                 @Html.EditorFor(model => model.Volume)
             </td>
             <td>@Html.ValidationMessageFor(model => model.Volume)</td>
         </tr>
         <tr>
             <th>
                 安全库存：
             </th>
             <td>
                 @Html.EditorFor(model => model.SafeStock)
             </td>
             <td>@Html.ValidationMessageFor(model => model.SafeStock)</td>
         </tr>
         <tr>
             <th>
                 说明：
             </th>
             <td>
                 @Html.EditorFor(model => model.Remark)
             </td>
             <td>@Html.ValidationMessageFor(model => model.Remark)</td>
         </tr>
         <tr>
             <th>
                 @Html.LabelFor(model => model.Status)：
             </th>
             <td>
                 @* @Html.EditorFor(model => model.Status)*@
                 @Html.DropDownListFor(model => model.Status, Apps.BLL.Sys.SysParamBLL.GetSysParamByType("Status"))
             </td>
             <td>@Html.ValidationMessageFor(model => model.Status)</td>
         </tr>
         @*<tr>
            <th>
                @Html.LabelFor(model => model.CreatePerson)：
            </th>
            <td>
                @Html.EditorFor(model => model.CreatePerson)
            </td>
            <td>@Html.ValidationMessageFor(model => model.CreatePerson)</td>
        </tr>
        <tr>
            <th>
                @Html.LabelFor(model => model.ModifyPerson)：
            </th>
            <td>
                @Html.EditorFor(model => model.ModifyPerson)
            </td>
            <td>@Html.ValidationMessageFor(model => model.ModifyPerson)</td>
        </tr>
        <tr>
            <th>
                @Html.LabelFor(model => model.ModifyTime)：
            </th>
            <td >
               @Html.TextBoxFor(model => model.ModifyTime, new { @onClick = "WdatePicker()",@style = "width: 105px" })
            </td>
            <td>@Html.ValidationMessageFor(model => model.ModifyTime)</td>
        </tr>*@
     </tbody>
</table>
}

